home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / Unit1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-06-27  |  1.0 KB  |  60 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     Edit1: TEdit;
  13.     Edit2: TEdit;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     procedure Button1Click(Sender: TObject);
  17.  
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   Form1: TForm1;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TForm1.Button1Click(Sender: TObject);
  32. var ebx, esi, ebp4, ebp8, serial, i : longint;
  33.     s: string[48];
  34. begin
  35. ebx:=0;
  36. esi:=0;
  37. ebp4:=0;
  38. ebp8:=0;
  39. s:=Edit2.text;
  40. if (length(s)>2) then
  41.   begin
  42.   for i:=1 to length(s) do
  43.     begin
  44.     ebx:=ebx+i*ord(s[i]);
  45.     esi:= 2*esi + ebx;
  46.     ebp4:= ebp4 + ebx + esi + i;
  47.     ebp8:= ebp8 + ebp4 - esi + ebx;
  48.     end; (* end of for *)
  49.  
  50.   serial:= $7FFFFFFF AND ((ebp4*ebp8 + esi) XOR EBX);
  51.   serial:=(serial XOR ebx) - ebx;
  52.  
  53.   Str(serial,s);
  54.   Edit1.text:=s;
  55.   end else
  56.   Edit1.text:='';
  57. end; (* end of if *)
  58.  
  59. end.
  60.